package com.mj.activity;

import android.content.Intent;
import android.os.Bundle;

import com.mj.R;
import com.mj.activity.user.Activity_Login;
import com.mj.activity.user.Activity_Sign;
import com.mj.base.BaseActivity;
import com.mj.util.Constant;
import com.mj.util.Info;

public class FlashActivity extends BaseActivity {
	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		if (Info.isLogin()) {
			setContentView(R.layout.activity_flash_login);
			aq.id(R.id.imageView1).clicked(this, "goMain");
		} else {
			setContentView(R.layout.activity_flash_unlogin);
			aq.id(R.id.button1).clicked(this, "signup");
			aq.id(R.id.button2).clicked(this, "login");
		}
	}

	@Override
	protected void onActivityResult(int arg0, int arg1, Intent arg2) {
		super.onActivityResult(arg0, arg1, arg2);
	}

	public void signup() {
		Intent intent = new Intent(this, Activity_Sign.class);
		startActivity(intent);
		finish();
	}

	public void login() {
		Intent intent = new Intent(this, Activity_Login.class);
		startActivityForResult(intent, Constant.NONE);
	}

	@Override
	public void goMain() {
		Intent intent = new Intent(this, MainActivity.class);
		startActivity(intent);
		finish();
		overridePendingTransition(R.anim.anim_down, R.anim.anim_up);
	}
}
